package com.estar.integaration.Impl.paymentPlanimpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.estar.integaration.Mapper.paymentPlanMapper.DontParseSupplierMapper;
import com.estar.integaration.Service.paymentPlanService.IDontParseSupplierService;
import com.estar.integaration.entity.paymentPlanEntity.DontParseSupplier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author YJL
 * @since 2022-03-25
 */
@Service
public class DontParseSupplierServiceImpl extends ServiceImpl<DontParseSupplierMapper, DontParseSupplier> implements IDontParseSupplierService {

  @Autowired
  DontParseSupplierMapper dontParseSupplierMapper;

  @Override
  public List<DontParseSupplier> getAllDontParseSupplier() {
    List<DontParseSupplier> dontParseSuppliers = dontParseSupplierMapper.selectList(null);
    return dontParseSuppliers;
  }

  @Override
  public void deleteDontParseSupplier(String supplierName) {
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("supplier_name",supplierName);
    dontParseSupplierMapper.delete(queryWrapper);
  }

  @Override
  public DontParseSupplier searchDontParseSupplier(String supplierName) {
    DontParseSupplier dontParseSupplier = new DontParseSupplier();
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("supplier_name",supplierName);
    dontParseSupplier = dontParseSupplierMapper.selectOne(queryWrapper);
    return dontParseSupplier;
  }

  @Override
  public List<DontParseSupplier> filterDontSupplier(String supplierName) {
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("supplier_name",supplierName);
    return dontParseSupplierMapper.selectList(queryWrapper);
  }
}
